package com.ellwood.common.core.exception;

import com.ellwood.common.core.enums.HttpCodeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

/**
 * @ProjectName: Ellwood-framework-boot
 * @PackageName: com.ellwood.common.core.exception
 * @ClassName: SystemException
 * @Description: // 自定义系统异常
 * @Author: Ellwood
 * @CreateDate: 2024/7/15 - 上午11:46
 * @Version: V1.0.0
 */
@Schema(description = "系统异常")
@Getter
public class SystemException extends RuntimeException {

    @Schema(description = "异常状态码")
    private Integer code;

    @Schema(description = "异常信息")
    private String msg;

    public SystemException(HttpCodeEnum httpCodeEnum) {
        super(httpCodeEnum.getMsg());

        this.code = httpCodeEnum.getCode();
        this.msg = httpCodeEnum.getMsg();

    }
}
